package main.Q1301_1400;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Q1341_1350 {
	public static void main(String[] args) {
		System.out.println("Question1341：");
		System.out.println("Question1342：将数字变成0的操作次数");
		System.out.println("Question1343：");
		System.out.println("Question1344：");
		System.out.println("Question1345：");
		System.out.println("Question1346：检查证书及其两倍数是否存在");
		System.out.println("Question1347：");
		System.out.println("Question1348：");
		System.out.println("Question1349：");
		System.out.println("Question1350：");
	}
}

class Question1342 {
	public int numberOfSteps(int num) {
		int result = 0;
		while (num != 0) {
			if (num % 2 == 0) num = num / 2;
			else num--;
			result++;
		}
		return result;
	}
}

class Question1346 {
	public boolean checkIfExist(int[] arr) {
		Set<Integer> set = new HashSet<>();
		Arrays.sort(arr);
		for (int num : arr) set.add(num);
		for (int i = 0; i < arr.length; i++) {
			if (i + 1 < arr.length && arr[i] == 0 && arr[i + 1] == 0) return true;
			if (arr[i] != 0 && set.contains(arr[i] * 2)) return true;
		}
		return false;
	}
}